package com.gengzi.item.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 分类管理实体类
 * @author 董诗攀
 */
@Table(name="tb_category")
@ApiModel(description="商品类目表，类目和商品(spu)是一对多关系，类目与品牌是多对多关系")
public class Category {
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @ApiModelProperty(value="类目i" )
    private Long id;
    @ApiModelProperty(value="类目名称" )
    private String name;
    @ApiModelProperty(value="父类目id,顶级类目填0" )
    private Long parentId;

    // 注意isParent生成的getter和setter方法需要手动加上Is
    @ApiModelProperty(value="是否为父节点，0为否，1为是" ,required=true)
    private Boolean isParent;
    @ApiModelProperty(value="排序指数，越小越靠前" )
    private Integer sort;
    // getter和setter略


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Boolean getIsParent() {
        return isParent;
    }

    public void setIsParent(Boolean parent) {
        isParent = parent;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }
}